package cn.dyw.cloudmusic.thread;

import cn.dyw.cloudmusic.http.CloudMusicHttpRequest;
import cn.dyw.cloudmusic.http.InitMusicParams;
import cn.dyw.cloudmusic.http.SaveHandle;
import cn.dyw.cloudmusic.http.model.LyricParams;
import cn.dyw.cloudmusic.http.model.Params;

/**
 * @author: dyw770
 * @Date: 2019/1/14 23:17
 * @Description: TODO
 */
public class LrcThreadRunnable implements Runnable {

    private String id;

    private InitMusicParams initMusicParams;

    private SaveHandle lrcSaveHandle;

    private CloudMusicHttpRequest cloudMusicHttpRequest;

    public LrcThreadRunnable(String id, SaveHandle lrcSaveHandle, CloudMusicHttpRequest cloudMusicHttpRequest) {
        this.id = id;
        Params p = new LyricParams(id);
        initMusicParams = new InitMusicParams(p);
        this.lrcSaveHandle = lrcSaveHandle;
        this.cloudMusicHttpRequest = cloudMusicHttpRequest;
    }

    @Override
    public void run() {
        cloudMusicHttpRequest.startCall(lrcSaveHandle, initMusicParams);
    }
}
